#!/usr/bin/python
# -*- encoding: utf-8 -*-
#
# Copyright (C) 2008 Håvard Gulldahl.
#
# Licensed under the GNU Public License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.gnu.org/licenses/gpl-2.0.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from distutils.core import setup
import os.path,  sys
from shutil import copy2

#from gcontacts import __version__ as ver
ver = '0.4' # sync with gcontacts

bitpimlitefiles = ('vcard.py',  'phonenumber.py',  'nameparser.py',  'common.py',  )

if '-u' in sys.argv:
  for f in bitpimlitefiles:
    srcfile = os.path.join('bitpim' , f)
    destfile = os.path.join('src',  'bitpimlite',  f)
    try:
      copy2(srcfile,  destfile)
    except (IOError, os.error), why:
      print "Can't copy %s to %s: %s" % (srcfile,  destfile, str(why))
      sys.exit(1)

setup(
  name='gcontacts',
  version=ver,
  description='Google Contacts Dropbox',
  long_description = """\
  Drag and drop contacts to and from Gmail/Google Contacts
""",
  author='Håvard Gulldahl',
  author_email='havard@gulldahl.no',
  license='GPL 2',
  url='http://gcontacts.googlecode.com/',
  scripts=['src/gcontacts.py', ], 
  packages=['bitpimlite',  'contactscopy',  'gcontacts'],
  package_dir = {'gcontacts':'src/gcontacts',  'bitpimlite':'src/bitpimlite', 'contactscopy':'src/contactscopy'}, 
  package_data = {'gcontacts':['data/gcontacts.ui']}
)
